<?php
/**
 * Created by PhpStorm.
 * User: trisatria
 * Date: 1/6/14
 * Time: 12:51 PM
 */

return array(
    'controllers' => array(
        'invokables' => array(
            'Admin\Controller\Topic' => 'Admin\Controller\TopicController',
            'Admin\Controller\User' => 'Admin\Controller\UserController',
            'Admin\Controller\Commend' => 'Admin\Controller\CommendController',
            'Admin\Controller\Categories' => 'Admin\Controller\CategoriesController',
            'Admin\Controller\TopicImg' => 'Admin\Controller\TopicImgController',
            'Admin\Controller\Login' => 'Admin\Controller\LoginController',
            'Admin\Controller\Config' => 'Admin\Controller\ConfigController',
            'Admin\Controller\Page' => 'Admin\Controller\PageController',
            'Admin\Controller\Tag' => 'Admin\Controller\TagController',

        ),
    ),

    'router' => array(
        'routes' => array(
            'admin' => array(
                'type'    => 'Literal',
                'priority'=> 3,
                'options' => array(
                    'route'    => '/admin_abc_xyz',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Admin\Controller',
                        'controller'    => 'Topic',
                        'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'child' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '[/:controller[/:action]][/:id][/topic/:topic_id]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'id'     => '[0-9]+',
                                'topic_id' => '[0-9]+',
                            ),
                            'defaults' => array(
                            ),
                        ),
                    ),
                ),
            ),
        ),
    ),
//    'router' => array(
//        'routes' => array(
//            'admintopic' => array(
//                'type'    => 'segment',
//                'options' => array(
//                    'route'    => '/admin/topic[/:action][/:id]',
//                    'constraints' => array(
//                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
//                        'id'     => '[0-9]+',
//                    ),
//                    'defaults' => array(
//                        'controller' => 'Admin\Controller\Topic',
//                        'action'     => 'index',
//                    ),
//                ),
//            ),
//            'admintuser' => array(
//                'type'    => 'segment',
//                'options' => array(
//                    'route'    => '/admin/user[/:action][/:id]',
//                    'constraints' => array(
//                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
//                        'id'     => '[0-9]+',
//                    ),
//                    'defaults' => array(
//                        'controller' => 'Admin\Controller\User',
//                        'action'     => 'index',
//                    ),
//                ),
//            ),
//            'admincategories' => array(
//                'type'    => 'segment',
//                'options' => array(
//                    'route'    => '/admin/categories[/:action][/:id]',
//                    'constraints' => array(
//                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
//                        'id'     => '[0-9]+',
//                    ),
//                    'defaults' => array(
//                        'controller' => 'Admin\Controller\Categories',
//                        'action'     => 'index',
//                    ),
//                ),
//            ),
//            'admincommend' => array(
//                'type'    => 'segment',
//                'options' => array(
//                    'route'    => '/admin/commend[/:action][/:id]',
//                    'constraints' => array(
//                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
//                        'id'     => '[0-9]+',
//                    ),
//                    'defaults' => array(
//                        'controller' => 'Admin\Controller\Commend',
//                        'action'     => 'index',
//                    ),
//                ),
//            ),
//        ),
//    ),
    'view_manager' => array(
	'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_path_stack' => array(
            'admin' => __DIR__ . '/../view',
        ),
    ),
    'module_layouts' => array(
        'Admin' => 'layout/backend',
		'error/404'               => __DIR__ . '/../view/error/404.phtml',
        'error/index'             => __DIR__ . '/../view/error/index.phtml',
    )
);